import React from 'react';
import './index.scss';

type defaultProps = {
  placeholder: string;
  value?: string; // 值
  tit: string;
  disabled?: Boolean;
  onChange?: (v: string) => void; // 更新事件
};

const Inputs = (props: defaultProps) => {
  const {
    placeholder = '请输入',
    value = '',
    onChange = () => {},
    disabled = false,
  } = props;
  return (
    <div className="line_inputs">
      <div className="tts">{props.tit}</div>
      <div className="in">
        <input
          type="text"
          placeholder={placeholder}
          value={value}
          disabled={disabled ? true : false}
          onInput={(e) => {
            onChange(e.currentTarget.value);
          }}
        />
      </div>
    </div>
  );
};

export default Inputs;
